﻿using Less.Core;
using Less.Core.Model;
using Less.SRV;

namespace Less.Tools
{
    public static class Test
    {
        public static void CreateTestData()
        {
            using ( var db = new Database(LessDatabaseUtils.LessConnectionStringName) )
            {
                db.Execute("DELETE  FROM ConfigSettings Where Culture is not null and Culture<>''");
            }
            var hello = new ConfigSetting {Code = "Hello", Value = "Hello", Culture = "en"};
            var hola = new ConfigSetting {Code = "Hello", Value = "Hola", Culture = "es"};
            var ola = new ConfigSetting {Code = "Hello", Value = "Olá", Culture = "pt"};
            var bye = new ConfigSetting {Code = "Bye", Value = "Good Bye", Culture = "en"};
            var adios = new ConfigSetting {Code = "Bye", Value = "Adios", Culture = "es"};
            var adeus = new ConfigSetting {Code = "Bye", Value = "Adeus", Culture = "pt"};
            var thanks = new ConfigSetting {Code = "Thanks", Value = "Thank You", Culture = "en"};
            var gracias = new ConfigSetting {Code = "Thanks", Value = "Gracias", Culture = "es"};
            var obrigado = new ConfigSetting {Code = "Thanks", Value = "Obrigado", Culture = "pt"};
            var please = new ConfigSetting {Code = "Please", Value = "Please", Culture = "en"};
            var porfavor = new ConfigSetting {Code = "Please", Value = "Por favor", Culture = "es"};
            var fagafavor = new ConfigSetting {Code = "Please", Value = "Faga o Favor", Culture = "pt"};
            var sivuple = new ConfigSetting {Code = "Please", Value = "Si Vu Plaise ", Culture = "fr"};
            var srv = new ConfigSRV(LessDatabaseUtils.LessConnectionStringName);
            srv.Create(hello);
            srv.Create(hola);
            srv.Create(bye);
            srv.Create(adios);
            srv.Create(ola);
            srv.Create(adeus);
            srv.Create(thanks);
            srv.Create(gracias);
            srv.Create(obrigado);
            srv.Create(please);
            srv.Create(porfavor);
            srv.Create(fagafavor);
            srv.Create(sivuple);
        }
    }
}